﻿@using Smartstore.Web.Models.Customers
@using Smartstore.Utilities.Html

@model CustomerReturnRequestsModel

@{
    Assets.AppendTitleParts(T("PageTitle.Account"));

    Layout = "_MyAccount";
    ViewBag.PageClassToken = "returnrequests";
    ViewBag.PageTitle = T("Account.CustomerReturnRequests").Value;
}

<ul class="return-request-grid list-unstyled" aria-labelledby="myaccount-header">
    @foreach (var item in Model.Items)
    {
        <li class="return-request-item mb-3" aria-labelledby="return-request-title@(item.Id)">
            <div class="card shadow-sm">
                <div class="card-body">
                    <div id="return-request-title@(item.Id)" class="card-title h4 mb-4">
                        @T("Account.CustomerReturnRequests.Title", item.Id, item.ReturnRequestStatus)
                    </div>
                    <dl class="row mb-0" role="presentation">
                        <dt class="col-sm-4 fwn text-muted">@T("Account.CustomerReturnRequests.Item")</dt>
                        <dd class="col-sm-8">
                            <a href="@item.ProductUrl" title="@T("Products.Details")" sm-language-attributes-for="item.ProductName">@item.ProductName</a>
                        </dd>
                        <dt class="col-sm-4 fwn text-muted">@T("ReturnRequests.Products.Quantity")</dt>
                        <dd class="col-sm-8">@item.Quantity</dd>
                        <dt class="col-sm-4 fwn text-muted">@T("Account.CustomerReturnRequests.Reason")</dt>
                        <dd class="col-sm-8">@item.ReturnReason</dd>
                        <dt class="col-sm-4 fwn text-muted">@T("Account.CustomerReturnRequests.Action")</dt>
                        <dd class="col-sm-8">@item.ReturnAction</dd>
                        <dt class="col-sm-4 fwn text-muted">@T("Account.CustomerReturnRequests.Date")</dt>
                        <dd class="col-sm-8">
                            <time asp-for="@item.CreatedOn" sm-format="f"></time>
                        </dd>
                        @if (item.Comments.HasValue())
                        {
                            <dt class="col-sm-4 fwn text-muted">@T("Account.CustomerReturnRequests.Comments")</dt>
                            <dd class="col-sm-8" dir="auto">@Html.Raw(HtmlUtility.ConvertPlainTextToHtml(item.Comments))</dd>
                        }
                    </dl>
                </div>
            </div>
        </li>
    }
</ul>
